from base.static import BaseStatic
from settings import *
from tools import create_sprite_dict


class GenericStatic(BaseStatic):
    def __init__(self, pos, surf, *group, z=PGLayers.main.value, **kwargs):
        super().__init__(pos, surf, *group, z=z)
        width = kwargs.get("width")
        height = kwargs.get("height")
        if width and height:
            self.hit_box = self.rect.copy().inflate(-self.rect.width * width, -self.rect.height * height)
        else:
            self.hit_box = self.rect.copy()


class ArmStatic(object):
    def __init__(self):
        self.display_surface = PG.display.get_surface()
        self.images = create_sprite_dict("arms.png")
        self.rect = self.images[0].get_rect(midbottom=PGStaticPos.arm.value)

    def display(self, index=0):
        index = index if index < len(self.images) else 0
        self.display_surface.blit(self.images[index], self.rect)


class SkillStatic(object):
    def __init__(self):
        self.display_surface = PG.display.get_surface()
        self.images = create_sprite_dict("skills.png")
        self.rect = self.images[0].get_rect(midbottom=PGStaticPos.skill.value)

    def display(self, index=0):
        index = index if index < len(self.images) else 0
        self.display_surface.blit(self.images[index], self.rect)
